import { HttpMethod, ContentType } from "../utils/HttpMethod"
import ApiInfo from "../index"

// 登录相关接口
const LoginApi = {
    userLogin: {
        serviceName: '',
        url: '/oauth/token',
        name: '登录',
        method: HttpMethod.POST,
        contentType: ContentType.FORM_DATA,
        param: {}
    } as ApiInfo,

    userRegister: {
        serviceName: '',
        url: '/user/register',
        name: '注册',
        method: HttpMethod.POST,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo,

    sendCaptcha: {
        serviceName: '',
        url: '/user/sendCaptcha',
        name: '发送验证码',
        method: HttpMethod.GET,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo,

    forgetPassword: {
        serviceName: '',
        url: '/auth/email/forgot-password',
        name: '忘记密码',
        method: HttpMethod.POST,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo,

    resetPassword: {
        serviceName: '',
        url: '/api/auth/user/reset-password',
        name: '重置密码',
        method: HttpMethod.POST,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo,

    permissionRoutes: {
        serviceName: '',
        url: '/user/permissionRoutes',
        name: '路由授权',
        method: HttpMethod.GET,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo,

    userInfo: {
        serviceName: '',
        url: '/user/userInfo',
        name: '用户信息',
        method: HttpMethod.GET,
        contentType: ContentType.JSON,
        param: {}
    } as ApiInfo
}

export default LoginApi;